package com.local.carousel.feign;

/**
 * carousel service远程调用接口
 */

import com.local.carousel.pojo.Carousel;
import com.local.carousel.pojo.CarouselDeleteRequestParam;
import com.local.carousel.pojo.CarouselListRequestParam;
import com.local.common.util.PageResultUtil;
import com.local.common.util.ResultUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("carouselservice")
public interface CarouselServiceFeign {

    /**
     * 查询数据列表，支持翻页
     * @param requestParam
     * @return
     */
    @GetMapping("/carousel/list")
    public ResultUtil<PageResultUtil<Carousel>> list(@RequestBody CarouselListRequestParam requestParam);

    /**
     * 根据id查询轮播图片数据
     * @param id
     * @return
     */
    @GetMapping("/carousel/info/{id}")
    @ResponseBody
    public ResultUtil info(@PathVariable("id") Integer id);

    /**
     * 新增
     * @param carousel
     * @return
     */
    @PostMapping("/carousel/save")
    @ResponseBody
    public ResultUtil save(@RequestBody Carousel carousel);


    /**
     * 修改
     * @param carousel
     * @return
     */
    @PostMapping("/carousel/update")
    @ResponseBody
    public ResultUtil update(@RequestBody Carousel carousel);

    /**
     * 删除，支持批量删除
     * @param carouselDeleteRequestParam
     * @return
     */
    @PostMapping("/carousel/delete")
    @ResponseBody
    public ResultUtil delete(@RequestBody CarouselDeleteRequestParam carouselDeleteRequestParam);


    /**
     * 查询轮播图（用于网站首页）
     * @return
     */
    @GetMapping("/carousel/list/index")
    @ResponseBody
    public ResultUtil<List<Carousel>> getCarouselList();
}
